home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / os2 / memsz313.zip / CATALA.CMD next >
OS/2 REXX Batch file  |  1996-01-17  |  3KB  |  149 lines

  1. /* CATALA.CMD: Instal·lació de MEMSIZE en català */
  2.  
  3. "@Echo Off"
  4. 'CHCP 850'
  5.  
  6. /* Càrregar REXXUTIL */
  7.  
  8. Call RxFuncAdd "SysLoadFuncs", "REXXUTIL", "SysLoadFuncs"
  9. Call SysLoadFuncs
  10.  
  11.  
  12. /* Initialize */
  13.  
  14. Signal On Failure Name FAILURE
  15. Signal On Halt Name HALT
  16. Signal On Syntax Name SYNTAX
  17.  
  18. Call SysCls
  19. Say "Instal·lació de MEMSIZE..."
  20. Say ""
  21.  
  22.  
  23. /* Verify the existence of the various component files. */
  24.  
  25. Language = "CATALA"
  26.  
  27. Result = SysFileTree( "MEMSIZE.EXE", "Files", "F" )
  28. If Files.0 = 0 Then
  29.   Do
  30.   Say "ERROR: No se troba el MEMSIZE.EXE!"
  31.   Signal DONE
  32.   End
  33.  
  34. Result = SysFileTree( Language".DLL", "Files", "F" )
  35. If Files.0 = 0 Then
  36.   Do
  37.   Say "ERROR: No se troba el "Language".DLL!"
  38.   Signal DONE
  39.   End
  40.  
  41. Result = SysFileTree( Language".HLP", "Files", "F" )
  42. If Files.0 = 0 Then
  43.   Do
  44.   Say "ERROR: No se troba el "Language".HLP!"
  45.   Signal DONE
  46.   End
  47.  
  48. /* Ask for the target directory name. */
  49.  
  50. Say "Si us plau, escribiu el nom complet del directori on voleu"
  51. Say "  instal·lar el programa MEMSIZE (per defecte és C:\OS2\APPS): "
  52. Parse Pull Directory
  53. If Directory = "" Then Directory = "C:\OS2\APPS"
  54.  
  55.  
  56. /* Create the target directory if necessary. */
  57.  
  58. Result = SysFileTree( Directory, "Dirs", "D" )
  59. If Dirs.0 = 0 Then
  60.   Do
  61.   Result = SysMkDir( Directory )
  62.   if Result == 0 Then
  63.     Do
  64.     End
  65.   Else
  66.     Do
  67.     Say "ERROR: No se pot crear el directori destí."
  68.     Signal DONE
  69.     End
  70.   End
  71. Say ""
  72.  
  73.  
  74. /* Ask for the target folder. */
  75.  
  76. Say "Voleu instal·lar-lo de forma que s'executi automàticament a l'arrencar? (S/N)"
  77. Pull YesNo
  78. If YesNo = "S" Then
  79.   Do
  80.   Folder = "<WP_START>"
  81.   Say "L'objecte es copiarà a la carpeta Inici."
  82.   End
  83. Else
  84.   Do
  85.   Folder = "<WP_DESKTOP>"
  86.   Say "L'objecte es copiarà a l'escriptori."
  87.   End
  88. Say ""
  89.  
  90.  
  91. /* Destroy the old object, if present. */
  92.  
  93. Call SysDestroyObject( '<MEMSIZE>' )
  94. Call SysSleep( 5 )
  95.  
  96.  
  97. /* Perform the installation. */
  98.  
  99. Say "Copiant MEMSIZE al directori " Directory "..."
  100. Copy MEMSIZE.EXE Directory                  "1>NUL"
  101. Copy Language".DLL" Directory"\MEMSIZE.DLL" "1>NUL"
  102. Copy Language".HLP" Directory"\MEMSIZE.HLP" "1>NUL"
  103. Copy Language".DOC" Directory"\MEMSIZE.DOC" "1>NUL"
  104.  
  105. Result = SysFileTree( "HLP2INF.EXE", 'Files', 'F' )
  106. If Files.0 > 0 Then
  107.    Do
  108.    Result = SysFileTree( Directory"\MEMSIZE.INF", 'Files', 'F' )
  109.    If Files.0 > 0 Then
  110.       Do
  111.       "Erase" Directory"\MEMSIZE.INF"
  112.       End
  113.    "HLP2INF" Directory"\MEMSIZE.HLP"
  114.    End
  115.  
  116. Result = SysFileTree( "SNAPSHOT.EXE", 'Files', 'F' )
  117. If Files.0 > 0 Then
  118.    Do
  119.    Copy "SNAPSHOT.EXE" Directory"\SNAPSHOT.EXE"  '1>NUL'
  120.    End
  121.  
  122. Say "Creant l'objecte del programa..."
  123. Type = "WPProgram"
  124. Title = "Recursos del Sistema"
  125. Parms = "OPEN=DEFAULT;MINWIN=DESKTOP;PROGTYPE=PM;EXENAME="Directory"\MEMSIZE.EXE;STARTUPDIR="Directory";OBJECTID=<MEMSIZE>;NOPRINT=YES;"
  126. Result = SysCreateObject( Type, Title, Folder, Parms, "ReplaceIfExists" )
  127.  
  128. If Result = 1 Then
  129.   Say "L'objecte s'ha creat.  Final"
  130. Else
  131.   Say "ERROR: No s'ha pogut crear l'objecte!"
  132.  
  133. Signal DONE
  134.  
  135. FAILURE:
  136. Say "Errada del REXX."
  137. Signal DONE
  138.  
  139. HALT:
  140. Say "S'atura el REXX."
  141. Signal DONE
  142.  
  143. SYNTAX:
  144. Say "Error de síntaxi del REXX."
  145. Signal DONE
  146.  
  147. DONE:
  148. Exit
  149.